package com.campus.controller;

import com.campus.entity.Class;
import com.campus.service.ClassService;
import com.campus.web.vo.ResponseResult;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;

@RestController
@RequestMapping("/class")
public class ClassController {
    @Autowired
    private ClassService classService;
    @PostMapping("/insert")
    public ResponseResult addClass(@RequestBody Class clazz) {
        classService.insertClass(clazz);
        return ResponseResult.ok("添加成功");
    }
    @PostMapping("/update")
    public ResponseResult updateClass(@RequestBody Class clazz) {
        classService.updateClass(clazz);
        return ResponseResult.ok("更新成功");
    }
}
